/*
 * @FileName: app_mppt.h
 * @Author: GreyQiu qiushaogui@aikosolar.com
 * @Date: 2023-08-08 17:15:32
 * @LastEditors: GreyQiu qiushaogui@aikosolar.com
 * @LastEditTime: 2023-09-13 17:52:16
 * @Description: 
 * 
 * Copyright (c) 2023, All Rights Reserved. 
 */

#ifndef __APP_MPPT_H__
#define __APP_MPPT_H__

#include <stdint.h>

typedef enum {
    MPPT_ID_BID = 0,  // 双向扰动
    MPPT_ID_FAST,     // 快速扰动
} mppt_id_t;

#define MPPT_PERIOD     500                     // mppt运行周期200ms

void app_mppt_run(uint16_t mppt_id);
void app_mppt_enable(uint16_t mppt_id);
void app_mppt_disable(uint16_t mppt_id);
void app_mppt_init(uint16_t mppt_id, float Voc, float ref);
float app_mppt_get_ref(uint16_t mppt_id);
void app_mppt_restart(uint16_t mppt_id);
uint16_t app_mppt_get_state(uint16_t mppt_id);
#endif // #ifndef __APP_MPPT_H__
